package org.thomias.exo1.tcp.agent;
import java.util.Random;

public class Main {
	public static void main(String[] args) {
		Runnable runServer = new Runnable() {

			public void run() {
				Server server = new Server();
				server.start();
			}
		};

		Thread threadServer = new Thread(runServer);
		threadServer.setName("server");

		threadServer.start();

		Client client = new Client();
		int rand = 0;
		while (rand != 50) {
			double d = new Random().nextDouble();
			rand = (int) (d * 1000);
			client.send("" + rand);
		}

		client.send("Aurevoir!");
		client.send("/quit");
	}

	public static void println(String msg) {
		System.out.println(msg);
	}
}
